#include<iostream>
using namespace std;

#include<deque>
#include<vector>
#include<list>
#include<algorithm>
#include"queue.h"
#include"stack.h"

int main()
{
	bit::stack<int> st;
	bit::queue<int> q;
	st.push(1);
	st.push(2);
	st.push(3);
	st.push(4);

	q.push(1);
	q.push(2);
	q.push(3);
	q.push(4);

	while (!st.empty())
	{
		int x = st.top();
		st.pop();
		cout << x << " ";
	}
	cout << endl;

	while (!q.empty())
	{
		int x = q.back();
		q.pop();
		cout << x << " ";
	}
	cout << endl;
	return 0;
}